
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible"content="IE=8"><!--以IE8模式渲染-->
    <meta http-equiv="X-UA-Compatible"content="IE=7"><!--以IE7模式渲染-->
    <meta http-equiv="X-UA-Compatible"content="IE=9; IE=8; IE=7; IE=EDGE">
    <title>员工新增</title>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/demo.css">
    <script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery.alert.v1.2/jquery.alert.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery_validate/css/validationEngine.jquery.css" >
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/form_table.css">
    <script type="text/javascript" src="__PUBLIC__/js/jquery_validate/js/jquery.validationEngine.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/jquery_validate/js/jquery.validationEngine-zh_CN.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/jquery.alert.v1.2/jquery.alert.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/ajax.js"></script>
</head>

<body>
<div id="tt">
    <div title="逾期备注新增">
        <div style="width:98%" class="form-panel">
            <div  id="form-link">
                <div class="easyui-panel" style="padding:5px;border-width: 0px;border-bottom-width: 1px;">
                    <a href="javscript:;" class="easyui-linkbutton" onclick="insert_overdueremark();" iconCls="icon-save" plain="true" style="width:80px">保存</a>
                    <a href="javscript:;" class="easyui-linkbutton" onclick="reset();" iconCls="icon-reload" plain="true" style="width:80px">重置</a>
                    <a href="javscript:;" class="easyui-linkbutton" onclick="close_tab();" iconCls="icon-undo" plain="true" style="width:80px">关闭</a>
                </div>
            </div>
            <div class="table_main">
                <form action="" id="defaultForm" method="post">
                    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
                        <input type="hidden" name="repay_detail_id" value="{$repay_detail_id}"/>
                        <input type="hidden" name="borrow_id" value="{$borrow_id}"/>
                        <tr>
                            <th width="131">名称</th>
                            <th>内容</th>
                        </tr>
                        <tr>
                            <td width="131">操作人员：</td>
                            <td>
                                <select  style="width:100px" class="validate[required]" name="user_id">
                                    <option value="">请选择</option>
                                    <foreach name="remarkuser_array" item="state">
                                        <option value="{$state.user_id}">{$state.user_name}</option>
                                    </foreach>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td width="131">备注内容：</td>
                            <td>
                                <textarea  name="remark_content" cols="83" rows="8" class="textArea validate[required]" /></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td width="131">约定还款日时间：</td>
                            <td>
                                <input name="remark_promisetime" placeholder="" class="easyui-datebox" value="" />
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $('#defaultForm').validationEngine();
    });
    function reset(){
        $("#defaultForm")[0].reset();
    }

    function close_tab(){
        var title="分期逾期备注查询";
        var url="../../borrow/borrowoverdue/overdueremark_list";
        window.parent.removeTab(title,url);
    }
    function insert_overdueremark(){
        if(!$("#defaultForm").validationEngine("validate")){
            return false;
        };
        var url="../../borrow/borrowoverdue/insert_overdueremark";
        var data=$("#defaultForm").serialize();
        jQuery.axse(url,data,ajax_overdueremark_success,ajax_error);
    }
    function ajax_overdueremark_success(data){
        console.log(data);
        var array = JSON.parse(data);
        alert(array.message);
        if(array.state==1){
            close_tab();
        }else{
            window.location.reload();
        }
    }
    function ajax_error(){
        alert("网络错误，请联系后台开发人员");
    }
</script>
</body>
</html>